/**
 * Copyright (c) 2016 Lenovo Group
 * All Rights Reserved.
 * 
 * Project Name:lmrp-api
 * Create Time: 2016年2月25日 上午10:42:51
 */
package com.lenovo.lmrp.api.constant;

import java.util.Objects;

/**
 * @author zhangzhenga
 *
 */
public enum TicketAction {

	GRAB("抢单"), CONFIRM("接单"), REJECT("退回"), APPOINT("预约"), REAPPOINT("改约"), RECONFIRM("下次再约"), SIGNIN("签到"), PICKPARTS(
			"取备件"), ATTACH("传附件"), FINISH("完成"), EVALUATE("评价"), CLOSE("关单"), BREAKOFF("快速结束"),REWORK("返工");

	private String descr;

	/**
	 * 
	 */
	private TicketAction(String descr) {
		this.descr = descr;
	}

	public String getDescr() {
		return this.descr;
	}

	public static TicketAction get(String action) {
		if (Objects.nonNull(action)) {
			for (TicketAction enumAction : TicketAction.values()) {
				if (enumAction.name().equalsIgnoreCase(action.toUpperCase())) {
					return enumAction;
				}
			}
		}
		return null;
	}
}
